﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cosmetic.DataEntity;

namespace WebApp.UserControl
{
    public partial class top : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null == Session["SignInUser"])
            {
                this.LabelUserName.Text = "jj-9原装进口葡萄酒在线商城欢迎您，您尚未";

            }
            else
            {
                this.LabelUserName.Text = "欢迎您，" + (Session["SignInUser"] as User).tel   + "!";
                this.HyperLinkLogin.Text = "退出";

            }

        }

        protected void HyperLinkLogin_Click(object sender, EventArgs e)
        {
            if (HyperLinkLogin.Text == "登录/注册")
            {
                HyperLinkLogin.Text = "退出";
                Response.Redirect("~/Login.aspx");
            }
            else if (HyperLinkLogin.Text == "退出")
            {
                Session.Clear();
                HyperLinkLogin.Text = "登录/注册";
                Response.Redirect("~/Login.aspx");

            }
        }
    }
}